package com.ruoyi.cms.service.impl;

import java.util.List;

import com.ruoyi.cms.domain.CmsDjContent;
import com.ruoyi.cms.mapper.CmsDjContentMapper;
import com.ruoyi.cms.service.ICmsDjContentService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 党建Service业务层处理
 * 
 * @author hct
 * @date 2022-01-22
 */
@Service
public class CmsDjContentServiceImpl implements ICmsDjContentService
{
    @Autowired
    private CmsDjContentMapper cmsDjContentMapper;

    /**
     * 查询党建
     * 
     * @param id 党建主键
     * @return 党建
     */
    @Override
    public CmsDjContent selectCmsDjContentById(Long id)
    {
        return cmsDjContentMapper.selectCmsDjContentById(id);
    }

    /**
     * 查询党建列表
     * 
     * @param cmsDjContent 党建
     * @return 党建
     */
    @Override
    public List<CmsDjContent> selectCmsDjContentList(CmsDjContent cmsDjContent)
    {
        return cmsDjContentMapper.selectCmsDjContentList(cmsDjContent);
    }

    /**
     * 新增党建
     * 
     * @param cmsDjContent 党建
     * @return 结果
     */
    @Override
    public int insertCmsDjContent(CmsDjContent cmsDjContent)
    {
        cmsDjContent.setCreateTime(DateUtils.getNowDate());
        return cmsDjContentMapper.insertCmsDjContent(cmsDjContent);
    }

    /**
     * 修改党建
     * 
     * @param cmsDjContent 党建
     * @return 结果
     */
    @Override
    public int updateCmsDjContent(CmsDjContent cmsDjContent)
    {
        cmsDjContent.setUpdateTime(DateUtils.getNowDate());
        return cmsDjContentMapper.updateCmsDjContent(cmsDjContent);
    }

    /**
     * 批量删除党建
     * 
     * @param ids 需要删除的党建主键
     * @return 结果
     */
    @Override
    public int deleteCmsDjContentByIds(Long[] ids)
    {
        return cmsDjContentMapper.deleteCmsDjContentByIds(ids);
    }

    /**
     * 删除党建信息
     * 
     * @param id 党建主键
     * @return 结果
     */
    @Override
    public int deleteCmsDjContentById(Long id)
    {
        return cmsDjContentMapper.deleteCmsDjContentById(id);
    }
}
